<?php
	include 'dbConfig2.php';
	//connect();
	selectDb('stdyplnr01');
	$data = file_get_contents("php://input");
	$dataString=(string)$data;
	$json=json_decode($data,true);
	$UseName=$json['UseName'];
	$UserPassword=$json['Password'];
	
	$query = "SELECT email,user_password,user_type FROM users where email  = '$UseName'";
	
	$result = runQuery($query);	
		$getUser_result = mysql_fetch_assoc($result);
		$dbpassword = $getUser_result['user_password'];
		$type = $getUser_result['user_type'];
		
		if($dbpassword == $UserPassword){
			session_start();
			$_SESSION['Status']='1';
			$_SESSION['name']= $UseName;
			echo $type;
		}
		else {
		
		echo 'Not-loged' ;
		}	
?>
















